CREATE SEQUENCE seruser            INCREMENT BY 1 START WITH 1
/

CREATE OR REPLACE PROCEDURE INSERTARSERVICIOUSR 
(
  NOMBRE IN VARCHAR2  
, DESCRIPCION IN VARCHAR2  
, USRNAME IN VARCHAR2  
) AS 

USRID NUMBER;
BEGIN

USRID:=0;

SELECT USR_ID INTO USRID FROM USUARIO WHERE USR_LOGIN = USRNAME;


INSERT INTO SERVICIO_USR (SUSR_ID,SUSR_NOMBRE,SUSR_DESCRIPCION,FKUSR_ID) VALUES 
  (seruser.NEXTVAL,NOMBRE,DESCRIPCION,USRID);
  

  NULL;
END INSERTARSERVICIOUSR;